﻿using System;
using System.Drawing;

namespace RPG1
{
    public class Magician: Role,  ISuperAttack 
    {
        public Magician() : base()
        {
        }

        public Magician(int id, string name, int originalLife, int currentLife, int damage, int agile, int brains, int speed, Point currentLocation, Point originaLocation, Weapon wpn)
            : base(id, name, originalLife, currentLife, damage, agile, brains, speed, currentLocation, originaLocation, wpn) { 
        }
            // 继承自父类的属性
          
        public override int getAttack()
        {
            return (int)((Damage * 2 + Brains * 4 + Wpn.Atk) * getSuperAttack());
        } //魔法师攻击力=力量*2+智力*4+武器的攻击力
        public override int getDefense()
        {
            return (int)(Agile * 3.6 + Damage * 1.5 + Brains * 2 + Wpn.Defense);
        } //魔法师防御力=敏捷*3.6+力量*1.5+智力*2+武器的防御力

        public double getSuperAttack()
        {
            Random rd = new Random();
            int probability = rd.Next(0, 101) + Wpn.Luck * 10;   // (生成0~101之间的随机数，不包括101)
            if (probability < 50)
                return 1;
            else
                return 1.5;
        }
    }
}
